package com.isp.org.server.domain.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isp.org.server.domain.entity.UserGroupEntity;
import com.isp.org.server.domain.mapper.UserGroupMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author linsy
 * @version 1.0
 * @created 2024/3/14 10:08
 */
@Service
@RequiredArgsConstructor
public class UserGroupService extends ServiceImpl<UserGroupMapper, UserGroupEntity> {

    private final UserGroupMapper userGroupMapper;

    public List<UserGroupEntity> selectByUserId(Long userId) {
        LambdaQueryWrapper<UserGroupEntity> userGroupLambdaQueryWrapper = new LambdaQueryWrapper<>();
        userGroupLambdaQueryWrapper.eq(UserGroupEntity::getUserId, userId);
        return userGroupMapper.selectList(userGroupLambdaQueryWrapper);
    }

}
